﻿using System;
using System.ComponentModel.DataAnnotations;
using Microsoft.EntityFrameworkCore;
using Volo.Abp.Domain.Entities;

namespace PasteLoggerBoard.serilogmodels
{
    /// <summary>
    /// 应用信息
    /// </summary>
    [Index(nameof(AppName), IsUnique = true)]
    public class AppInfo:Entity<int>
    {

        /// <summary>
        /// 应用代码 在配置文件中相互匹配 16
        /// </summary>
        [MaxLength(16)]
        public string AppName { get; set; }

        /// <summary>
        /// 显示名称 32
        /// </summary>
        [MaxLength(32)]
        public string DisplayName { get; set; } = "";

        /// <summary>
        /// 介绍 128
        /// </summary>
        [MaxLength(128)]
        public string Desc { get; set; } = "";

        /// <summary>
        /// 排序
        /// </summary>
        public int Sort { get; set; } = 0;

        /// <summary>
        /// 过滤规则 一行一个数据，行打头 1024
        /// </summary>
        [MaxLength(1024)]
        public string InfoFilterRoute { get; set; } = "";

        /// <summary>
        /// info日志入库
        /// </summary>
        public bool InfoSaveData { get; set; } = false;

        /// <summary>
        /// 日志保存几个小时 只有入库的才会生效
        /// </summary>
        public int InfoSaveHour { get; set; } = 4;

        /// <summary>
        /// 警告日志 入库
        /// </summary>
        public bool WarnSaveData { get; set; } = true;

        /// <summary>
        /// 警告日志保存天数 只有入库的才会生效
        /// </summary>
        public int WarnSaveDay { get; set; } = 30;

        /// <summary>
        /// 过滤规则 一行一个数据，行打头 1024
        /// </summary>
        [MaxLength(1024)]
        public string WarnFilterRoute { get; set; } = "";

        /// <summary>
        /// 错误日志入库
        /// </summary>
        public bool ErrorSaveData { get; set; } = true;

        /// <summary>
        /// 错误日志保存天数
        /// </summary>
        public int ErrorSaveDay { get; set; } = 60;

        /// <summary>
        /// 过滤规则 一行一个数据，行打头 1024
        /// </summary>
        [MaxLength(1024)]
        public string ErrorFilterRoute { get; set; } = "";

    }
}
